Skip to content

Conversation

@abhishek-01k
Copy link
Contributor

@abhishek-01k abhishek-01k commented Jan 20, 2025

Closes #49 and #51

  1. Added UniversalAddress as export in ui-kit
const {universalAddress} = usePushWalletContext(); // inside-dapp

export type UniversalAddress = {
  chainId: string | null;
  chain: string | null;
  address: string;
}; // type of universalAddress
  1. ENV exports are also changed, added a CONSTANTS export in ui-kit that will export all the enums of ui-kit
import { CONSTANTS } from '@pushprotocol/pushchain-ui-kit'; // inside-app

export const CONSTANTS = {
  ENV: ENV,
  WALLET_TO_APP_ACTION: WALLET_TO_APP_ACTION,
  APP_TO_WALLET_ACTION: APP_TO_WALLET_ACTION,
}; // type of Constants
  1. Push Wallet button for connecting to any dapp.
import { PushWalletButton,centerMaskString,usePushWalletContext } from '@pushprotocol/pushchain-ui-kit'; // inside-app

const { universalAddress } = usePushWalletContext();

1. <PushWalletButton universalAddress={universalAddress} /> // using built-in component
2. <PushWalletButton
   universalAddress={universalAddress}
   title="Connect Wallet"
/>
3. <PushWalletButton
    universalAddress={universalAddress}
    styling={{
       backgroundColor: '#10B981',
       borderRadius: '9999px',
       padding: '12px 24px',
     }}
/>
4. <PushWalletButton
      universalAddress={universalAddress}
      component={
          <Button variant="secondary">
              {universalAddress ? (
                 <>{centerMaskString(universalAddress.address)}</>
                ) : (
                  <> Connect With Push Wallet</>
                )}
           </Button>
      }
/>

Procedure for this PR:

  • Deploy the ui-kit package to a newer version of ui-kit.
  • Update the ui-kit package in the core-connection module and use the new version.
  • Deploy the core-connection module to a simulate.push.org and then check the changes.
  • Remove the internal export of components from ui-kit in core-connection module.

@abhishek-01k abhishek-01k changed the title Added universalAddress as export in ui-kit UI-Kit exports fix Jan 21, 2025
@abhishek-01k abhishek-01k changed the title UI-Kit exports fix Redefining UI-Kit component and functions exports Jan 21, 2025
@riyanshu-patro riyanshu-patro merged commit 9aef816 into main Feb 10, 2025
@riyanshu-patro riyanshu-patro deleted the UI-KIT-49-fixed-ui-kit-export-for-account branch February 10, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change account export type in ui-kit package

3 participants